package com.xunyin.modules.mtrefund.service.mapper;


import com.xunyin.common.mapper.CoreMapper;
import com.xunyin.modules.mtrefund.domain.MtRefund;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

/**
 * 售后表 Mapper 接口
 *
 * Created by xunyinyunshang <3594419785@qq.com>
 * CopyRight 讯音云商 https://www.tonetn.com
 */
public interface MtRefundMapper extends CoreMapper<MtRefund> {

    @Select("SELECT count(0) as num FROM mt_refund t where t.CREATE_TIME &lt; #{endTime} and t.CREATE_TIME &gt;= #{beginTime}")
    Long getRefundCount(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    @Select("select * from mt_refund t where t.ORDER_ID = #{orderId} and t.STATUS != 'D'")
    MtRefund findByOrderId(@Param("orderId") Integer orderId);

}
